import Vue from './instance/vue'
import installGlobalAPI from './global-api'
import { inBrowser, devtools } from './util/index'
import config from './config'

installGlobalAPI(Vue)

Vue.version = '1.0.20'

export default Vue

// devtools global hook
/* istanbul ignore next */
if (config.devtools) {
  if (devtools) {
    devtools.emit('init', Vue)
  } else if (
    process.env.NODE_ENV !== 'production' &&
    inBrowser && /Chrome\/\d+/.test(window.navigator.userAgent)
  ) {
    console.log(
      'Download the Vue Devtools for a better development experience:\n' +
      'https://github.com/vuejs/vue-devtools'
    )
  }
}
